package com.huangpuweb.task.controller;

import com.huangpuweb.task.model.NjdlTotalNumber;
import com.huangpuweb.task.service.SyncSysDataService;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
//暂时由大数据做定时任务
@Controller
public class SyncNjdlTotalNumberJob {
    @Resource
    private SyncSysDataService syncSysDataService;
    public void getNjdlTotalNumberTask(){
        LogFactory.getLog(this.getClass()).info("--------start-------getNjdlTotalNumberTask----------" + new Date());

        List<NjdlTotalNumber> totalNumberList=syncSysDataService.getNjdlTotalNumberTask();
        for (NjdlTotalNumber number : totalNumberList) {
            NjdlTotalNumber  ss=   syncSysDataService.findNjdlTotaolNumber(number.getTimes());
            if (ss==null) {
                syncSysDataService.insertNjdlTotalNumber(number);
            }
        }
    }
}
